Optimal. Leaf size=227 \[ \frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}-\frac {(C (1+m+n)+A (2+m+n)) (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1+m+n);\frac {1}{2} (3+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a d (1+m+n) (2+m+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (a \cos (c+d x))^{2+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (2+m+n);\frac {1}{2} (4+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a^2 d (2+m+n) \sqrt {\sin ^2(c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {20, 3102, 2827,
2722} \begin {gather*} -\frac {B \sin (c+d x) (a \cos (c+d x))^{m+2} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+2);\frac {1}{2} (m+n+4);\cos ^2(c+d x)\right )}{a^2 d (m+n+2) \sqrt {\sin ^2(c+d x)}}-\frac {(A (m+n+2)+C (m+n+1)) \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (m+n+1);\frac {1}{2} (m+n+3);\cos ^2(c+d x)\right )}{a d (m+n+1) (m+n+2) \sqrt {\sin ^2(c+d x)}}+\frac {C \sin (c+d x) (a \cos (c+d x))^{m+1} (b \cos (c+d x))^n}{a d (m+n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 20
Rule 2722
Rule 2827
Rule 3102
Rubi steps
\begin {align*} \int (a \cos (c+d x))^m (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx &=\left ((a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}+\frac {\left ((a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} (a (C (1+m+n)+A (2+m+n))+a B (2+m+n) \cos (c+d x)) \, dx}{a (2+m+n)}\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}+\frac {\left (B (a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{1+m+n} \, dx}{a}+\frac {\left ((C (1+m+n)+A (2+m+n)) (a \cos (c+d x))^{-n} (b \cos (c+d x))^n\right ) \int (a \cos (c+d x))^{m+n} \, dx}{2+m+n}\\ &=\frac {C (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \sin (c+d x)}{a d (2+m+n)}-\frac {(C (1+m+n)+A (2+m+n)) (a \cos (c+d x))^{1+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1+m+n);\frac {1}{2} (3+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a d (1+m+n) (2+m+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (a \cos (c+d x))^{2+m} (b \cos (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (2+m+n);\frac {1}{2} (4+m+n);\cos ^2(c+d x)\right ) \sin (c+d x)}{a^2 d (2+m+n) \sqrt {\sin ^2(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 161, normalized size = 0.71 \begin {gather*} -\frac {\cos (c+d x) (a \cos (c+d x))^m (b \cos (c+d x))^n \sin (c+d x) \left ((C (1+m+n)+A (2+m+n)) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1+m+n);\frac {1}{2} (3+m+n);\cos ^2(c+d x)\right )+(1+m+n) \left (B \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (2+m+n);\frac {1}{2} (4+m+n);\cos ^2(c+d x)\right )-C \sqrt {\sin ^2(c+d x)}\right )\right )}{d (1+m+n) (2+m+n) \sqrt {\sin ^2(c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.29, size = 0, normalized size = 0.00 \[\int \left (a \cos \left (d x +c \right )\right )^{m} \left (b \cos \left (d x +c \right )\right )^{n} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \cos {\left (c + d x \right )}\right )^{m} \left (b \cos {\left (c + d x \right )}\right )^{n} \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (a\,\cos \left (c+d\,x\right )\right )}^m\,{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________